FileSetPos command

Syntax
FileSetPos refNum, mark

Description
Sets the current mark (position) in a file opened using FileOpen. Use FileSetPos to move the mark forward or backward in an open file; future FileRead and FileWrite operations always begin at the file’s current mark. To set the mark to the beginning of the file, set the mark to 0 (zero). To set the mark to the byte following the last byte in the file, set the mark to the file’s length (obtainable using FileGetEOF).

Examples
Variable theFile, refNum, theData
theFile = (FindFolder "desk") & "FileIO Demo"
File(theFile).Text = "First line" & Return & "Second line"
refNum = FileOpen theFile
FileSetPos refNum, 6      // Sets the file’s mark to the byte following the 6th byte
theData = FileRead refNum, "all"
FileClose refNum
Message theData

See Also
Using the FileIO extension (page 136)

Author Info
FileSetPos, part of FileIO Extension
Copyright © 1998 Life OnLine Software (lr). All rights reserved.